#ifndef __G_SCENE_MANAGER_H__
#define __G_SCENE_MANAGER_H__

#include <vector>

#include "GGameObject.h"
#include "../../Foundation/GUtilities/GTypes.h"
#include "../../Foundation/GUtilities/GSingleton.h"
#include "../../Foundation/GUtilities/GInitializable.h"

namespace GEngine
{
	//!++ Convert this into gscene instead of manager. game can hold more than one scene

	class GVisitor;

	class GSceneManager : public GUtil::GInitializable, public GUtil::GSingleton<GSceneManager>
	{
	friend class GUtil::GSingleton<GSceneManager>;

	typedef std::vector<GGameObject*> GameObjectArray;

	private:
		GameObjectArray	GameObjects;

						GSceneManager();
						~GSceneManager();		

	public:
		GUInt32			GetObjectCount() const;

		void			RemoveAll();

		GGameObject*	Find(const char* Name);

		void			Append(GGameObject* Object);
		void			Remove(GGameObject* Object);

		bool			Contains(GGameObject* Object) const;	

		void			TraverseScene(GVisitor* Visitor);

		bool			Initialize() OVERRIDE;
		void			Uninitialize() OVERRIDE;
	};

}; // namespace GScene

#define mGSceneManager	GEngine::GSceneManager::GetInstance()

#endif // __G_SCENE_MANAGER_H__
